package com.fingersoft.feature.common

import android.app.Application
import android.content.Context
import cn.fingersoft.util.BuildConfigUtil
import com.fingersoft.business.BusinessContext
import com.fingersoft.business.router.start
import com.fingersoft.common.ICheckApiCallBack

internal abstract class SealCheckApiContext2(val application: Application) : ICheckApiCallBack {
    override fun onKickOffLine() {
        BusinessContext.user?.kickedOfflineByOtherClient(application)
    }

    override fun onLogout() {
        BusinessContext.user?.kickedOfflineByOtherClient(application)
    }

    override fun onApiError(errCode: Int) {
        BusinessContext.mVPNProvider?.onApiError(errCode)
    }

    override fun openUserCircle(context: Context, id: String) {
        context.start("user_circle", null) { intent -> intent.putExtra("userid", id) }
    }

    override fun isUseUIVersion2(): Boolean? {
        return "ui2" == BuildConfigUtil.getString("setUIVersion", "ui1")
    }
}
